<?php
    require '../../feed/config/config.php';
	session_start();
	$ConnfigRs=mysqli_fetch_array(mysqli_query($con,"select * from config where id='1'"));
	if(empty($_SESSION['member'])){
	    echo "<script>location='../index.php';</script>";
	}
	if($_GET['clubId']==""){
	    echo "<script>location='./index.php';</script>";
	}else{
	    $clubRs=mysqli_fetch_array(mysqli_query($con,"select * from club where id='".$_GET['clubId']."'")); 
	    if($clubRs['name']==""){
	        echo "<script>location='./index.php';</script>";
	    }else{
	        $userRs=mysqli_fetch_array(mysqli_query($con,"select * from clubUser where user='".$_SESSION['member']."' and clubId='".$_GET['clubId']."'"));
            $clubIdentityRs=mysqli_fetch_array(mysqli_query($con,"select * from clubIdentity where id='".$userRs['identityId']."'"));
            if($clubIdentityRs['identityName']!="创建者"){
                echo "<script>alert('暂无权限');location='./index.php';</script>";
            }
            if($_GET['uid']!=""){
                $uRs=mysqli_fetch_array(mysqli_query($con,"select * from clubUser where id='".$_GET['uid']."'"));
                if($uRs['user']!=""){
                    if($_GET['ops']=="yes"){
                        mysqli_query($con,"update clubUser set identityId='3' where id='".$_GET['uid']."'");
                        echo "<script>alert('操作成功');</script>";
                    }
                    if($_GET['ops']=="no"){
                        mysqli_query($con,"DELETE FROM clubUser where id='".$_GET['uid']."'");
                        echo "<script>alert('操作成功');</script>";
                    }
                }
            }
	    }
	}
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8"/>
    <title>社团中心</title>
    <script type="text/javascript" src="../js/base-loading.min.js"></script>
    <script type="text/javascript" src="../js/layui.js"></script>
    <link rel="stylesheet" href="../css/style.css"/>
    <link rel="stylesheet" href="../css/layui.css"/>
  </head>
  <body>
    <div class="s_header w">
      <div class="s_header_top w">
        <div class="header_top w1000 auto">
          <div class="header_top_fl fl">欢迎访问<?php echo $ConnfigRs['name'];?></div>
          <div class="header_top_fr fr"><span class="header_email dib"></span><span class="header_tel dib"></span>
            <div class="cb"></div>
          </div>
          <div class="cb"></div>
        </div>
      </div>
      <div class="s_header_nav w">
        <div class="header_nav w1000 auto">
          <div class="logo fl"><a href="index.html"><img src="http://www.huayu.edu.cn/template/huayu/listimages/logo.png" alt=""/></a></div>
        </div>
      </div>
    </div>
    <div class="banner">
      <div id="banner" class="dv_5"><a href="" style=" background:url(../images/hy.png) center center no-repeat; display: block; z-index: 1; " class="d1"></a><a href="" style=" background:url(images/banner2.png) center center no-repeat; display: block; z-index: 1; " class="d1"></a><a href="" style=" background:url(images/banner3.png) center center no-repeat; display: block; z-index: 1; " class="d1"></a>
      </div>
    </div>
    <div class="s_cen w">
      <div class="center w1000 auto">
          <br />
                <p><a href="../index.php">首页</a> / <a href="./index.php">社团中心</a> / <a href="./club.php?clubId=<?php echo $_GET['clubId'];?>">社团首页</a> / 社团管理</p>
                <br /><br />
                社团成员：<br />
                <p><?php
                    $club=mysqli_query($con,"select * from clubUser where clubId='".$_GET['clubId']."'");
            		while($clubRs=mysqli_fetch_array($club)){
            		    $clubIdentityRs=mysqli_fetch_array(mysqli_query($con,"select * from clubIdentity where id='".$clubRs['identityId']."'"));
                        echo "账号:".$clubRs['user']." | 加入时间：".$clubRs['addTime']." | 身份：".$clubIdentityRs['identityName']." | 操作：";
                        if($clubIdentityRs['identityName']=="未审核新用户"){
                            echo "<a href='?clubId=".$_GET['clubId']."&uid=".$clubRs['id']."&ops=yes'>审核通过</a> | <a href='?clubId=".$_GET['clubId']."&uid=".$clubRs['id']."&ops=no'>删除</a><br />";
                        }else{
                            echo "暂无操作<br />";
                        }
                    }
                ?></p>
                
      </div>
    </div>
    <div class="s_footer w">
      <div class="footer w1000 auto">
        <div class="footer_fl fl">
          <div class="footer_logo"><a href=""><img src="http://www.huayu.edu.cn/template/huayu/images/logo.png"  alt="" width="100%"/></a></div>
          <div class="footer_line"></div>
          <div class="footer_fl_ul">
            
          </div>
          <div class="cb"></div>
          <div class="footer_fl_record"></div>
        </div>
        <div class="footer_fr fr">
          <div class="footer_fr_top"></div>
          <div class="footer_line"></div>
         
          <div class="footer_from">｜<a href="" target="_blank">XXX</a></div>
        </div>
      </div>
    </div>
    <script type="text/javascript" src="../js/jquery-1.8.1.min.js"></script>
    <!--首页banner特效-->
    <script type="text/javascript" src="../js/banner.js"></script>
    <script type="text/javascript" src="../js/main.js"> </script>
    <script type="text/javascript" src="../js/jquery.SuperSlide.2.1.1.js"></script>
</body>
</html>